package com.wanlian.router.ui.main.yun;

import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;

import com.smart.android.ui.BaseActivity;
import com.smart.android.utils.FileUtils;
import com.wanlian.router.R;

import butterknife.BindView;

/**
 * Created by Hyu on 2018/9/23.
 * Email: fvaryu@163.com
 */
public class YunFileTranslateActivity extends BaseActivity {

    @BindView(R.id.tab_layout)
    TabLayout mTabLayout;
    @BindView(R.id.viewpager)
    ViewPager mViewPager;

    @Override
    protected int layout() {
        return R.layout.activity_yun_file_translate;
    }


    @Override
    public void initUI() {
        super.initUI();
        setTitle("云盘");

        mViewPager.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) {
            @Override
            public Fragment getItem(int i) {
                switch (i) {
                    case 1: {
                        return DownFragment.newInstance();
                    }
                    case 0: {
                        return UploadFragment.newInstance();
                    }
                }
                return null;
            }

            @Override
            public int getCount() {
                return 2;
            }

            @Nullable
            @Override
            public CharSequence getPageTitle(int position) {
                switch (position) {
                    case 0:
                        return "上传";
                    case 1:
                        return "下载";
                }
                return null;
            }
        });

        mTabLayout.setupWithViewPager(mViewPager);

        com.smart.android.utils.UIUtils.setIndicator(mTabLayout, 50, 50);




    }

    @Override
    public void initData() {
        super.initData();

    }


}
